package io;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

// Scanner 进行字符读取
public class Demo8 {
    public static void main(String[] args) throws IOException {
        // ————  使用 Scanner 查询  ————
        try (InputStream in = new FileInputStream("Demo.txt")) {
            try (Scanner scanner = new Scanner(in,"UTF-8")) {
                while (scanner.hasNext()) {
                    String s = scanner.next();
                    System.out.println(s);
                }
            }
        }

    }
}
